// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

// 图表界面
import statistics from '@/views/charts/statistics';

/**
 * 菜品管理
 */
//菜品列表
import Dishes from '@/views/dishes/Dishes';
//菜品分类
import Category from '@/views/dishes/Category';

/**
 * 订单管理
 */
//订单列表
import Indents from '@/views/indent/Indents';
//评论列表
import Comment from '@/views/indent/Comment';
//退款订单
import Chargeback from '@/views/indent/Chargeback';
//订单统计
import Count from '@/views/indent/Count';

/**
 * 活动管理
 */
//满减列表
import Coupon from '@/views/activity/Coupon';
//用户满减
import UserCoupon from '@/views/activity/UserCoupon';


/**
 * 用户管理
 */
//用户列表
import User from '@/views/user/User';
/**
 * 系统管理
 */
//店铺管理
import Shop from '@/views/system/Shop';
//员工管理
import Staff from '@/views/system/Staff';
//角色管理
import StaffRole from '@/views/system/StaffRole';
//菜单管理
import LeftMenu from '@/views/system/LeftMenu';
//权限管理
import StaffJurisdictoin from '@/views/system/StaffJurisdictoin';

/**
 * 基础管理
 */
//个人中心
import SelfCenter from '@/views/basics/SelfCenter';


// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/dishes/Dishes',
            name: '菜品列表',
            component: Dishes,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/dishes/Category',
            name: '菜品分类',
            component: Category,
            meta: {
                requireAuth: true
            }
        },{
            path: '/indent/Indents',
            name: '订单列表',
            component: Indents,
            meta: {
                requireAuth: true
            }
        },{
            path: '/indent/Comment',
            name: '评论列表',
            component: Comment,
            meta: {
                requireAuth: true
            }
        },{
            path: '/indent/Chargeback',
            name: '退款管理',
            component: Chargeback,
            meta: {
                requireAuth: true
            }
        },{
            path: '/indent/Count',
            name: '订单统计',
            component: Count,
            meta: {
                requireAuth: true
            }
        },{
            path: '/activity/Coupon',
            name: '满减列表',
            component: Coupon,
            meta: {
                requireAuth: true
            }
        },{
            path: '/activity/UserCoupon',
            name: '用户满减',
            component: UserCoupon,
            meta: {
                requireAuth: true
            }
        },{
            path: '/user/User',
            name: '用户管理',
            component: User,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/Shop',
            name: '店铺管理',
            component: Shop,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/Staff',
            name: '员工管理',
            component: Staff,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/StaffRole',
            name: '角色管理',
            component: StaffRole,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/LeftMenu',
            name: '菜单管理',
            component: LeftMenu,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/StaffJurisdictoin',
            name: '权限管理',
            component: StaffJurisdictoin,
            meta: {
                requireAuth: true
            }
        },{
            path: '/basics/SelfCenter',
            name: '个人中心',
            component: SelfCenter,
            meta: {
                requireAuth: true
            }
        },{
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }]
    }]
})
